﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/SiteContent.Master" AutoEventWireup="true"
    CodeBehind="BillList.aspx.cs" Inherits="Warehouse.Web.Sales.BillList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .datatable {
            width: 100%;
        }
        .status_1 {
            color: Red;
        }
    </style>

    <script type="text/javascript">
        function search() {
            window.location.href = "BillList.aspx?search=1&Start=" + $('#<%= this.tbStartDate.ClientID %>').val() + "&End=" + $('#<%= this.tbEndDate.ClientID %>').val();
        }
        function showBill(Id, type) {
            if (type > 0) {
                var title = ["", "销售单", "销售赠品单", "销售退货单"][type];
                top.showWindow("/Sales/BillView.aspx?ID=" + Id, { title: title, width: 700, height: 500 }, function(refresh) {
                    if (refresh) {
                        window.location.reload();
                    }
                });
            } else {
                var title = ["", '销售收款单', '退货付款单'][0 - type];
                top.showWindow("/Sales/PaymentView.aspx?ID=" + Id, { title: title, width: 700, height: 500 }, function(refresh) {
                    if (refresh) {
                        window.location.reload();
                    }
                });
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="moduleheader">
        <h4>
            单据查询</h4>
        <div class="moduleheadertoolbar">
            <label>
                录入日期：
                <asp:TextBox ID="tbStartDate" runat="server" CssClass="datepicker"></asp:TextBox>
            </label>
            <label>
                —
                <asp:TextBox ID="tbEndDate" runat="server" CssClass="datepicker"></asp:TextBox>
            </label>
            <input type="button" class="ui-button-query" onclick="search();return false;" value="查询" />
        </div>
    </div>
    <div class="modulecontent">
        <asp:Repeater ID="rptBills" runat="server">
            <HeaderTemplate>
                <table class="datatable">
                    <thead>
                        <tr>
                            <th class="col-sn">
                                单据编号
                            </th>
                            <th class="col-date">
                                录入日期
                            </th>
                            <th class="col-supplier">
                                供货商
                            </th>
                            <th class="col-type">
                                类型
                            </th>
                            <th class="col-house">
                                仓库
                            </th>
                            <th class="col-summary">
                                摘要
                            </th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="status_<%# Eval("Status")%>">
                    <td class="col-sn">
                        <a href="#<%# Eval("ID")%>" onclick="showBill('<%# Eval("ID")%>',<%# Eval("Type")%>);return false;">
                            <%# Eval("SerialNumber")%></a>
                    </td>
                    <td class="col-date">
                        <%# Eval("Date","{0:d}")%>
                    </td>
                    <td class="col-supplier">
                        <%# Eval("SupplierName")%>
                    </td>
                    <td class="col-type">
                        <%# Eval("TypeName")%>
                    </td>
                    <td class="col-house">
                        <%# Eval("HouseName") %>
                    </td>
                    <td class="col-summary">
                        <%# Eval("Summary")%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>
